package com.dormms.www.bll;

import com.dormms.www.dal.ContactDAO;
import com.dormms.www.entity.Contact;

import java.sql.SQLException;
import java.util.ArrayList;

public class ContactService {
    private ContactDAO contactDAO = new ContactDAO();

    public void addContact(Contact contact) throws SQLException {
        contactDAO.addContact(contact);
    }

    public void updateContact(Contact contact) throws SQLException {
        contactDAO.updateContact(contact);
    }

    public void deleteContact(int id) throws SQLException {
        contactDAO.deleteContact(id);
    }

    public ArrayList<Contact> getAllContacts() throws SQLException {
        return contactDAO.getAllContacts();
    }
}